QuickOPC User's Guide and Reference
Value Conversions, String Formats and Converters
Development Models > Live Binding Model > Live Binding Model for OPC Data (Classic and UA) > Value Conversions, String Formats and Converters
In This Topic

When values are transferred to or from the target, value conversions can be made – using intrinsic conversionsstring formats, or data converters.

Intrinsic Conversions

The intrinsic conversions do not have to be configured, and are applied automatically when needed.

The Live Binding infrastructure contains following intrinsic conversions :

String Formats

In order to format the bound value according to a string format, simply set the StringFormat property of the binding. An empty string means no formatting. The format string is constructed according to usual .NET rules, and can contain following placeholders:

The string formatting is only applied in one direction – for values being transferred from the binding source to the binding target.

In addition to formats defined by the .NET Framework, QuickOPC defines format strings for various its types, and especially the types used in Live Binding, such as DAQuality, DAVtqUAAttributeData, UAStatusCode, etc. This makes it easy to format compound values for display purposes, without having to write any code. For details, please refer to Format Strings in the Reference.

Data Converters

When string formatting is not sufficient, any kind of conversion can be made using data converters, and possibly in both directions. Data converters are objects that implement the IDataConverter interface. You can place converters on the design surface of the form, and then select from them for the Converter property of any binding.

QuickOPC ships with several data converters, described in the subsequent chapters.

Besides using the data converter(s) that ship with the product, you can create your own data converter objects or components, and assign them to your bindings.

See Also

Knowledge Base